
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>svg 之 filter · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    
    <link rel="prev" href="../svg之clipPath和mask/svg之clipPath和mask.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../svg基础/svg基础.html">
            
                <a href="../svg基础/svg基础.html">
            
                    
                    svg 基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../svg基本图形/svg基本图形.html">
            
                <a href="../svg基本图形/svg基本图形.html">
            
                    
                    svg 基本图形
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../svg之path/svg之path.html">
            
                <a href="../svg之path/svg之path.html">
            
                    
                    svg 之 path
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../svg描边动画/svg描边动画.html">
            
                <a href="../svg描边动画/svg描边动画.html">
            
                    
                    svg 描边动画
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../svg之fill及fill-rule/svg之fill及fill-rule.html">
            
                <a href="../svg之fill及fill-rule/svg之fill及fill-rule.html">
            
                    
                    svg 之 fill 及 fill-rule
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../svg之viewBox/svg之viewBox.html">
            
                <a href="../svg之viewBox/svg之viewBox.html">
            
                    
                    svg 之 viewBox
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../svg分组与复用/svg分组与复用.html">
            
                <a href="../svg分组与复用/svg分组与复用.html">
            
                    
                    svg 分组与复用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../svg之marker/svg之marker.html">
            
                <a href="../svg之marker/svg之marker.html">
            
                    
                    svg 之 marker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../svg文本/svg文本.html">
            
                <a href="../svg文本/svg文本.html">
            
                    
                    svg 文本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.11" data-path="../svg之pattern/svg之pattern.html">
            
                <a href="../svg之pattern/svg之pattern.html">
            
                    
                    svg 之 pattern
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.12" data-path="../svg之clipPath和mask/svg之clipPath和mask.html">
            
                <a href="../svg之clipPath和mask/svg之clipPath和mask.html">
            
                    
                    svg 之 clipPath 和 mask
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.13" data-path="svg之filter.html">
            
                <a href="svg之filter.html">
            
                    
                    svg 之 filter
            
                </a>
            

            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >svg 之 filter</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="svg-&#x4E4B;-filter">SVG &#x4E4B; filter</h2>
<p><img src="imgs/filter.png" alt="filter"></p>
<p>&#x7528;&#x8FC7; Photoshop &#x7684;&#x5C0F;&#x4F19;&#x4F34;&#x5E94;&#x8BE5;&#x5BF9;&#x6EE4;&#x955C;&#x4E0D;&#x964C;&#x751F;&#x3002;&#x6EE4;&#x955C;&#x53EF;&#x7528;&#x6765;&#x505A;&#x4E00;&#x4E9B;&#x7279;&#x6B8A;&#x5316;&#x6548;&#x679C;&#x5904;&#x7406;&#xFF0C;&#x529F;&#x80FD;&#x5F88;&#x5F3A;&#x5927;&#x3002;SVG &#x4E5F;&#x662F;&#x4E00;&#x79CD;&#x56FE;&#x5F62;&#x683C;&#x5F0F;&#xFF0C;&#x6EE4;&#x955C;&#x529F;&#x80FD;&#x600E;&#x4E48;&#x80FD;&#x5C11;&#x5462;&#x3002;</p>
<p>&#x6EE4;&#x955C;&#xFF1A;filter&#xFF0C;&#x662F; SVG &#x4E2D;&#x4E00;&#x4E2A;&#x5F88;&#x91CD;&#x8981;&#x7684;&#x7279;&#x6027;&#x3002;&#x56E0;&#x4E3A;&#x5B83;&#x53EF;&#x4EE5;&#x8BA9; SVG &#x7684;&#x8868;&#x73B0;&#x529B;&#x66F4;&#x52A0;&#x5F3A;&#x5927;&#x3002;</p>
<pre><code class="lang-html"><span class="hljs-comment">&lt;!-- &#x5B9A;&#x4E49; feGaussianBlur &#x6EE4;&#x955C; #blur--&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">filter</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;blur&quot;</span> <span class="hljs-attr">height</span>=<span class="hljs-string">&quot;0.5&quot;</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">feGaussianBlur</span> <span class="hljs-attr">stdDeviation</span>=<span class="hljs-string">&quot;6&quot;</span> /&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">filter</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">circle</span> <span class="hljs-attr">cx</span>=<span class="hljs-string">&quot;60&quot;</span> <span class="hljs-attr">cy</span>=<span class="hljs-string">&quot;60&quot;</span> <span class="hljs-attr">r</span>=<span class="hljs-string">&quot;50&quot;</span> <span class="hljs-attr">fill</span>=<span class="hljs-string">&quot;#E91E63&quot;</span> /&gt;</span>
<span class="hljs-comment">&lt;!-- &#x5F15;&#x7528; #blur --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">circle</span> <span class="hljs-attr">cx</span>=<span class="hljs-string">&quot;170&quot;</span> <span class="hljs-attr">cy</span>=<span class="hljs-string">&quot;60&quot;</span> <span class="hljs-attr">r</span>=<span class="hljs-string">&quot;50&quot;</span> <span class="hljs-attr">fill</span>=<span class="hljs-string">&quot;#E91E63&quot;</span> <span class="hljs-attr">filter</span>=<span class="hljs-string">&quot;url(#blur)&quot;</span> /&gt;</span>
</code></pre>
<p><img src="imgs/filter1.svg" alt="filter1"></p>
<h2 id="filterunits">filterUnits</h2>
<p>&#x7528;&#x4E8E;&#x51B3;&#x5B9A; filter &#x7684; <code>x</code>&#x3001;<code>y</code>&#x3001;<code>width</code>&#x3001;<code>height</code> &#x7684;&#x5982;&#x4F55;&#x8BA1;&#x7B97;&#x3002;&#x6709;&#x5982;&#x4E0B;&#x4E24;&#x79CD;&#x53D6;&#x503C;&#xFF1A;</p>
<ul>
<li><p>objectBoundingBox&#xFF1A;&#x76F8;&#x5BF9;&#x4E8E;&#x5F15;&#x7528;&#x5143;&#x7D20;&#x7684;&#x5BBD;&#x3001;&#x9AD8;&#x8BA1;&#x7B97;&#x3002;&#x9ED8;&#x8BA4;&#x503C;&#x3002;</p>
</li>
<li><p>userSpaceOnUse&#xFF1A;&#x7EDD;&#x5BF9;&#x503C;&#xFF0C;&#x5373;&#x76F4;&#x63A5;&#x4F7F;&#x7528;&#x8BBE;&#x5B9A;&#x7684;&#x503C;&#x3002;</p>
</li>
</ul>
<p>&#x5F53; <code>patternUnits=&quot;userSpaceOnUse&quot;</code> &#x65F6;&#xFF0C; <code>x</code>&#x3001;<code>y</code>&#x3001;<code>width</code>&#x3001;<code>height</code> &#x76F4;&#x63A5;&#x4F7F;&#x7528;&#x8BBE;&#x5B9A;&#x7684;&#x503C;&#xFF1B;&#x5F53; <code>patternUnits=&quot;objectBoundingBox&quot;</code> &#x65F6;&#xFF0C; <code>x</code>&#x3001;<code>y</code>&#x3001;<code>width</code>&#x3001;<code>height</code> &#x8BBE;&#x5B9A;&#x7684;&#x503C;&#x662F; <strong>&#x6BD4;&#x4F8B;&#x503C;</strong>&#xFF0C;&#x9700;&#x8981;&#x6839;&#x636E;&#x5F15;&#x7528;&#x5143;&#x7D20;&#x7684;&#x5BBD;&#x9AD8;&#x8FDB;&#x884C;&#x8BA1;&#x7B97;&#x3002;&#x5176;&#x4E2D; <code>x</code>&#x3001;<code>width</code> &#x53C2;&#x8003;&#x5F15;&#x7528;&#x5143;&#x7D20;&#x7684;&#x5BBD; <code>w1</code>&#xFF0C;<code>y</code>&#x3001;<code>height</code> &#x53C2;&#x8003;&#x5F15;&#x7528;&#x5143;&#x7D20;&#x7684;&#x9AD8; <code>h1</code>&#x3002;</p>
<h2 id="primitiveunits">primitiveUnits</h2>
<p>&#x4E0E; <code>filterUnits</code> &#x7C7B;&#x4F3C;&#xFF0C;&#x53EA;&#x662F;&#x4F5C;&#x7528;&#x5BF9;&#x8C61;&#x4E0D;&#x540C;&#x3002;<code>filterUnits</code> &#x4F5C;&#x7528;&#x4E8E; filter &#x5143;&#x7D20;&#xFF0C;&#x800C; <code>primitiveUnits</code> &#x4F5C;&#x7528;&#x4E8E; filter &#x5143;&#x7D20;&#x5185;&#x7684;&#x5185;&#x5BB9;&#x3002;&#x53E6;&#x5916;&#xFF0C;&#x8FD8;&#x6709;&#x4E00;&#x4E2A;&#x4E0D;&#x540C;&#x70B9;&#xFF0C;<code>filterUnits</code> &#x7684;&#x9ED8;&#x8BA4;&#x503C;&#x4E3A; <code>objectBoundingBox</code>&#xFF0C;&#x800C; <code>primitiveUnits</code> &#x9ED8;&#x8BA4;&#x503C;&#x4E3A; <code>userSpaceOnUse</code>&#x3002;</p>
<h2 id="&#x6EE4;&#x955C;&#x5217;&#x8868;">&#x6EE4;&#x955C;&#x5217;&#x8868;</h2>
<ul>
<li>feBlend&#xFF1A;&#x6839;&#x636E;&#x7279;&#x5B9A;&#x7684;&#x6DF7;&#x5408;&#x6A21;&#x5F0F;&#x5C06;&#x4E24;&#x4E2A;&#x5BF9;&#x8C61;&#x7EC4;&#x5408;&#x5728;&#x4E00;&#x8D77;&#x3002;&#x7C7B;&#x4F3C;&#x4E8E; <strong>PS</strong> &#x4E2D;&#x7684;&#x6DF7;&#x5408;&#x6A21;&#x5F0F;&#x3002;</li>
<li>feColorMatrix&#xFF1A;&#x6839;&#x636E;&#x8F6C;&#x6362;&#x77E9;&#x9635;&#x66F4;&#x6539;&#x989C;&#x8272;&#x3002;</li>
<li>feComponentTransfer&#xFF1A;&#x6BCF;&#x4E2A;&#x50CF;&#x7D20;&#x6267;&#x884C;&#x989C;&#x8272;&#x5206;&#x91CF;&#x6570;&#x636E;&#x7684;&#x91CD;&#x65B0;&#x6620;&#x5C04;&#x3002; &#x5B83;&#x5141;&#x8BB8;&#x8FDB;&#x884C;&#x8BF8;&#x5982;&#x4EAE;&#x5EA6;&#x8C03;&#x8282;&#xFF0C;&#x5BF9;&#x6BD4;&#x5EA6;&#x8C03;&#x8282;&#xFF0C;&#x8272;&#x5F69;&#x5E73;&#x8861;&#x6216;&#x9608;&#x503C;&#x8BBE;&#x7F6E;&#x4E4B;&#x7C7B;&#x7684;&#x64CD;&#x4F5C;&#x3002;<ul>
<li>feFuncR</li>
<li>feFuncG</li>
<li>feFuncB</li>
<li>feFuncA</li>
</ul>
</li>
<li>feComposite&#xFF1A;&#x6DF7;&#x5408;&#x56FE;&#x7247;&#xFF0C;&#x53EF;&#x4EE5;&#x6309;&#x767E;&#x5206;&#x6BD4;&#x7684;&#x65B9;&#x5F0F;&#x8FDB;&#x884C;&#x6DF7;&#x5408;&#x3002;</li>
<li>feConvolveMatrix&#xFF1A;&#x77E9;&#x9635;&#x5377;&#x79EF;&#x8BA1;&#x7B97;&#x3002;&#x80FD;&#x8BA1;&#x7B97;&#x51FA;&#x6A21;&#x7CCA;&#xFF0C;&#x8FB9;&#x7F18;&#x68C0;&#x6D4B;&#xFF0C;&#x9510;&#x5316;&#xFF0C;&#x6D6E;&#x96D5;&#x548C;&#x659C;&#x89D2;&#x7B49;&#x6548;&#x679C;&#x3002;</li>
<li>feDisplacementMap&#xFF1A;&#x4F4D;&#x7F6E;&#x66FF;&#x6362;&#x6EE4;&#x955C;&#x3002;&#x5373;&#x6539;&#x53D8;&#x5143;&#x7D20;&#x548C;&#x56FE;&#x5F62;&#x7684;&#x50CF;&#x7D20;&#x4F4D;&#x7F6E;&#x3002;</li>
<li>feDiffuseLighting&#xFF1A;&#x4F7F;&#x7528; alpha &#x901A;&#x9053;&#x4F5C;&#x4E3A;&#x51F9;&#x51F8;&#x8D34;&#x56FE;&#x6765;&#x7167;&#x4EAE;&#x56FE;&#x50CF;&#x3002;</li>
<li>feSpecularLighting&#xFF1A;&#x4F7F;&#x7528; alpha &#x901A;&#x9053;&#x4F5C;&#x4E3A;&#x51F9;&#x51F8;&#x8D34;&#x56FE;&#x6765;&#x7167;&#x4EAE;&#x6E90;&#x56FE;&#x5F62;&#x3002;</li>
<li>fePointLight&#xFF1A;&#x5B9A;&#x4E49;&#x5149;&#x6E90;&#xFF0C;&#x8BE5;&#x5149;&#x6E90;&#x53EF;&#x4EE5;&#x521B;&#x5EFA;&#x70B9;&#x5149;&#x6E90;&#x6548;&#x679C;&#x3002;</li>
<li>feSpotLight&#xFF1A;&#x5B9A;&#x4E49;&#x5149;&#x6E90;&#xFF0C;&#x8BE5;&#x5149;&#x6E90;&#x53EF;&#x4EE5;&#x521B;&#x5EFA;&#x805A;&#x5149;&#x706F;&#x6548;&#x679C;&#x3002;</li>
<li>feSpotLight&#xFF1A;&#x5B9A;&#x4E49;&#x5149;&#x6E90;&#xFF0C;&#x8BE5;&#x5149;&#x6E90;&#x53EF;&#x4EE5;&#x521B;&#x5EFA;&#x805A;&#x5149;&#x706F;&#x6548;&#x679C;&#x3002;</li>
<li>feFlood&#xFF1A;&#x4F7F;&#x7528; <code>flood-color</code> &#x548C; <code>flood-opacity</code> &#x5B9A;&#x4E49;&#x7684;&#x989C;&#x8272;&#x548C;&#x4E0D;&#x900F;&#x660E;&#x5EA6;&#x586B;&#x5145;&#x6EE4;&#x955C;&#x5B50;&#x533A;&#x57DF;&#x3002;</li>
<li>feGaussianBlur&#xFF1A;&#x9AD8;&#x65AF;&#x6A21;&#x7CCA;&#x3002;</li>
<li>feImage&#xFF1A;&#x63D2;&#x5165;&#x4E00;&#x5F20;&#x56FE;&#x7247;&#x6210;&#x4E3A;&#x6EE4;&#x955C;&#x3002;</li>
<li>feMerge&#xFF1A;&#x4E0D;&#x540C;&#x6EE4;&#x955C;&#x7684;&#x7EC4;&#x5408;<ul>
<li>feMergeNode</li>
</ul>
</li>
<li>feMorphology&#xFF1A;&#x7528;&#x4E8E;&#x8150;&#x8680;&#x6216;&#x6269;&#x5927;&#x8F93;&#x5165;&#x56FE;&#x50CF;&#xFF0C;&#x5B83;&#x7684;&#x4F5C;&#x7528;&#x5C24;&#x5176;&#x5728;&#x4E8E;&#x589E;&#x8102;&#x6216;&#x7A00;&#x758F;&#x6548;&#x679C;&#x3002;</li>
<li>feOffset&#xFF1A;&#x79FB;&#x52A8;&#x5F15;&#x7528;&#x6EE4;&#x955C;&#x7684;&#x5143;&#x7D20;&#x7684;&#x4F4D;&#x7F6E;&#x3002;</li>
<li>feTile&#xFF1A;&#x4F7F;&#x7528;&#x8F93;&#x5165;&#x56FE;&#x50CF;&#x7684;&#x91CD;&#x590D;&#x5E73;&#x94FA;&#x56FE;&#x6848;&#x586B;&#x5145;&#x76EE;&#x6807;&#x77E9;&#x5F62;&#x3002; &#x6548;&#x679C;&#x7C7B;&#x4F3C;&#x4E8E; <code>&lt;pattern&gt;</code>&#x3002;</li>
<li>feTurbulence&#xFF1A;&#x521B;&#x5EFA;&#x9707;&#x8361;&#x4E0E;&#x7EB9;&#x7406;&#x3002;</li>
</ul>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="../svg之clipPath和mask/svg之clipPath和mask.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: svg 之 clipPath 和 mask">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"svg 之 filter","level":"1.13","depth":1,"previous":{"title":"svg 之 clipPath 和 mask","level":"1.12","depth":1,"path":"svg之clipPath和mask/svg之clipPath和mask.md","ref":"./svg之clipPath和mask/svg之clipPath和mask.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"svg之filter/svg之filter.md","mtime":"2019-10-18T10:17:28.971Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-10-21T06:03:10.264Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

